home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / admin / squota-0.02 / Squota.tar / Squota / Squota < prev    next >
Text File  |  1996-05-13  |  1KB  |  37 lines

  1. #!/bin/bash
  2. # Squota - Screwed Quota        Copyright (c) 1996 Gary Barrueto
  3. ##############################################################################
  4. # Squota - This scripts kepts track of current users list..
  5. ##############################################################################
  6. # Load variables - Read the /var/adm/Squota/quotavars to find out $VARIBLES
  7. ##############################################################################
  8.  
  9. . /var/adm/Squota/quotavars
  10.  
  11. ##############################################################################
  12. # WHAT THIS NEEDS, make the next line so it check users via /etc/passwd
  13. ##############################################################################
  14. # get list of personal home dirs
  15. # get rid of "lost+found" dir if it exists
  16. # get rid of quota files... 
  17. ##############################################################################
  18.  
  19. "ls" $WHATDIR | grep -v found | grep -v quota > /var/adm/Squota/quota.users
  20.  
  21. #######
  22. # USER LIST just got created
  23. # NOW its time to find how much, in Kilobytes, is stored currently in
  24. # the users home.
  25. #######
  26.  
  27. while test $PULENGTH != $EMPTY
  28. do
  29.   EMPTY=`expr $EMPTY + 1`
  30.   UHOME=`head -$EMPTY $HQ/quota.users | tail -1`
  31.  
  32.   # Start Logging
  33.  
  34.   FSUSAGE=`eval du -s ~$UHOME | cut -f1`
  35.   echo $FSUSAGE >> $HQ/$UHOME.$MON
  36. done
  37.